package cn.wangxl.loglog;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Description TODO
 * @Classname LogLogApp
 * @Created by wangxl
 * @Date 2020/5/11 22:50
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class LogLogApp {

    public static void main(String[] args) throws IOException {
        SpringApplication.run(LogLogApp.class);

    }

    public static void test(int i) throws IOException {

        Process p = Runtime.getRuntime().exec("ping " + "192.168.0."+i);
        BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
        String line = null;
        StringBuilder sb = new StringBuilder();
        while ((line = br.readLine()) != null) {
            if (line.length() != 0)
                sb.append(line + "\r\n");
        }
        System.out.println("本次指令返回的消息是：");
        System.out.println(sb.toString());
    }
}
